<p><label for="npost_title">主题</label><br/>
 <%= text_field("post", "title", "size" => 60)%>
</p>
 <% if !@categories.nil?%>
<p><label for="post_category">类别</label><br/>

<table width="70%" border="0">
  <tr>
    <td width="20%">
 <% if @post.post_category.nil? -%>
 <%= select_tag('parent_id', options_for_select(@categories),
                :onchange => remote_function( :url => {:action => 'cat_changed'} ,
                :loading => "Element.hide('select2'), Element.show('loading-gif'), document.getElementById('submit_ok').disabled = true",
                :complete => "Element.show('select2'), Element.hide('loading-gif'), document.getElementById('submit_ok').disabled = false",
                :with => "Form.Element.serialize(this)",
                :update => 'select2' ) 
                ) %>
 <% else -%>
 <%= select_tag('parent_id', options_for_select(@categories, @post.post_category.parent.id),
                :onchange => remote_function( :url => {:action => 'cat_changed'} ,
                :loading => "Element.hide('select2'), Element.show('loading-gif'), document.getElementById('submit_ok').disabled = true",
                :complete => "Element.show('select2'), Element.hide('loading-gif'), document.getElementById('submit_ok').disabled = false",
                :with => "Form.Element.serialize(this)",
                :update => 'select2' ) 
                ) %>
 <% end -%>
    </td>
    <td width="80%">
    <div id='select2'>
      <%= render :partial=>'childCat'%>
    </div>
    <%= image_tag("/images/loadingw.gif", :id => "loading-gif", :style => "display:none")%>
    </td>
  </tr>
</table>
 <% end %>
<p><label for="post_content">内容</label><br/>
 <%= fckeditor_textarea("post", "content", {:toolbarSet => 'Simple', :width => '99%', :height => '200px', :value => ''}) %>
</p>
<p><label for="post_tags">标签:(使用标签可以更好的归类)</label><br/>
<%= text_field("newpost", "tags", :size => 50, :value => @tags_text, :style => "width: 99%")%>
</p>
  
</p>
